<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<html>
<head>
    <title>古画商城-后台管理</title>
</head>
<body>
<jsp:include page="header.jsp"/>

<c:if test="${empty admin}">
    <jsp:forward page="login.jsp"></jsp:forward>
</c:if>
<c:if test="${!empty admin}">
    <div class="container-fluid">
        <div class="row">
            <div class="col-md-12">
                <div class="row">
                    <div class="col-md-1">
                    </div>
                    <div class="col-md-10">
                        <div class="row">
                            <c:if test="${!empty ancientPaintings}">
                                <c:forEach items="${ancientPaintings}" var="touristAttraction" varStatus="vs">
                                    <div class="col-md-6 ancient-painting-item">
                                        <div class="ancient-painting-item__body">
                                            <div style="float: right;">
                                                <a href="purchase.ancientPainting?id=${touristAttraction.id}">
                                                    <img src="${pageContext.request.contextPath}/images/shopping-cart.png" alt="" width="24" height="24">
                                                </a>
                                            </div>
                                            <div style="float: right; position:relative; right: 20px; color: #33a7e2">${touristAttraction.price}¥</div>
                                            <div style="color: #0b2e13"><h2>${touristAttraction.name}</h2></div>
                                            <div style="float: right">
                                                <c:if test="${touristAttraction.path.length() > 0}">
                                                    <img src="${touristAttraction.path}" width="250" height="200" alt="加载失败"/>
                                                </c:if>
                                                <c:if test="${touristAttraction.path.length() == null || touristAttraction.path.length() == 0}">
                                                    <img src="images/img_blank.png" width="250" height="200"/>
                                                </c:if>
                                            </div>
                                            <div>分类：${touristAttraction.catalogName}</div>
                                            <div>画家：${touristAttraction.author}</div>
                                            <div>出版社：${touristAttraction.press}</div>
                                        </div>
                                    </div>
                                </c:forEach>
                            </c:if>
                            <c:if test="${empty ancientPaintings}">
                                <div class="col-md-12">无</div>
                            </c:if>
                        </div>
                        <div class="row">
                            <c:if test="${!empty number}">
                                <a href='showCart.ancientPainting'>您已购买 ${number} 幅画，查看购物车</a>
                            </c:if>
                        </div>
                    </div>
                </div>
                <div class="col-md-1">
                </div>
            </div>
        </div>
    </div>

</c:if>
<style type="text/css">
    .ancient-painting-item {
        height: 300px;
        padding: 8px;
    }

    .ancient-painting-item__body {
        height: 100%;
        padding: 8px;
        overflow: hidden;
        border-radius: .25rem;
        border: 2px solid #f3f3f3;
        background: linear-gradient(to right, #ebeef5, #f2f6fc);
    }
</style>
</body>
</html>